import java.io.File

import com.typesafe.config.ConfigFactory

/**
  * Created by kylin on 17-2-26.
  */
object  config {

  def main(args: Array[String]) {
    val conf=ConfigFactory.load("app")   // from app.conf app.properties ...

    conf.getString("name")
    conf.getString("nick")      // nick refers ${name} in config file

    conf.getString("db.host")   // db is an object
    conf.getInt("db.port")

    conf.getString("no-such") // throws exception

    val obj=conf.getObject("db")
    val objCnf=conf.getConfig("db")    // db is an object
    objCnf.getString("host")  // conf.getString("db.host")
    objCnf.getInt("port")
  }
}
